﻿//********************************************************************
// Author:      刘艳明
// Create Date: 2012-08-25
// Description: 
//
// Version:     1.0.0.0
// Change History:
// Date		    Who		      Changes Made
//--------------------------------------------------------------------
// Please Insert the Modiy record here!
//--------------------------------------------------------------------
//********************************************************************


using System;
using System.Collections.Generic;
using System.Data;

using MillerApp.DataAccess;
using MillerApp.DataContract.MillerDB;
using Npgsql;
using NpgsqlTypes;
using MillerApp.CommonLib.DataAccess;

namespace MillerApp.DataAccess.MillerDB
{
    /// <summary>
    /// 这个类提供了对Stockquotations ()表的数据库操作
    /// </summary>
    public static partial class StockquotationsManager
    {
        private static IDBHelper db = MillerAppDBHelper.CreateDatabase();

        static string insertSQL = "INSERT INTO stockquotations (outflowretail,inflowretail,outflowmain,inflowmain,changeratio,turnoverrate,modifytime,createtime,sellingprice5,sellingvolume5,sellingprice4,sellingvolume4,sellingprice3,sellingvolume3,sellingprice2,sellingvolume2,sellingprice1,sellingvolume1,buyingprice5,buyingvolume5,buyingprice4,buyingvolume4,buyingprice3,buyingvolume3,buyingprice2,buyingvolume2,buyingprice1,buyingvolume1,reserveprice,competitiveprice,tradingmoneyvolume,tradingvolume,todaylowestprice,todayhighestprice,todayclosingprice,yesterdayclosingprice,todayopeningprice,tradeday,seccode) VALUES (@outflowretail,@inflowretail,@outflowmain,@inflowmain,@changeratio,@turnoverrate,@modifytime,@createtime,@sellingprice5,@sellingvolume5,@sellingprice4,@sellingvolume4,@sellingprice3,@sellingvolume3,@sellingprice2,@sellingvolume2,@sellingprice1,@sellingvolume1,@buyingprice5,@buyingvolume5,@buyingprice4,@buyingvolume4,@buyingprice3,@buyingvolume3,@buyingprice2,@buyingvolume2,@buyingprice1,@buyingvolume1,@reserveprice,@competitiveprice,@tradingmoneyvolume,@tradingvolume,@todaylowestprice,@todayhighestprice,@todayclosingprice,@yesterdayclosingprice,@todayopeningprice,@tradeday,@seccode)";

        static string updateSQL = "Update stockquotations Set outflowretail=@outflowretail,inflowretail=@inflowretail,outflowmain=@outflowmain,inflowmain=@inflowmain,changeratio=@changeratio,turnoverrate=@turnoverrate,modifytime=@modifytime,createtime=@createtime,sellingprice5=@sellingprice5,sellingvolume5=@sellingvolume5,sellingprice4=@sellingprice4,sellingvolume4=@sellingvolume4,sellingprice3=@sellingprice3,sellingvolume3=@sellingvolume3,sellingprice2=@sellingprice2,sellingvolume2=@sellingvolume2,sellingprice1=@sellingprice1,sellingvolume1=@sellingvolume1,buyingprice5=@buyingprice5,buyingvolume5=@buyingvolume5,buyingprice4=@buyingprice4,buyingvolume4=@buyingvolume4,buyingprice3=@buyingprice3,buyingvolume3=@buyingvolume3,buyingprice2=@buyingprice2,buyingvolume2=@buyingvolume2,buyingprice1=@buyingprice1,buyingvolume1=@buyingvolume1,reserveprice=@reserveprice,competitiveprice=@competitiveprice,tradingmoneyvolume=@tradingmoneyvolume,tradingvolume=@tradingvolume,todaylowestprice=@todaylowestprice,todayhighestprice=@todayhighestprice,todayclosingprice=@todayclosingprice,yesterdayclosingprice=@yesterdayclosingprice,todayopeningprice=@todayopeningprice,tradeday=@tradeday,seccode=@seccode Where id=@id";

        static string deleteSQL = "DELETE FROM  stockquotations  Where id=@id";

        #region codesmith生成的代码
        /// <summary>
        /// 获取StockquotationsEntity实体 
        /// </summary>
        /// <param name="id">id</param>
        /// <returns>StockquotationsEntity</returns>
        public static StockquotationsEntity GetStockquotationsEntity(int id)
        {
            string strSQL = "select * from stockquotations where id=@id";
            IDbDataParameter para_id = new NpgsqlParameter("id", NpgsqlDbType.Integer);
            para_id.Value = id;
            IDbDataParameter[] paras = new IDbDataParameter[] { para_id };


            StockquotationsEntity entity = new StockquotationsEntity();
            using (System.Data.IDataReader reader = db.ExecuteReader(strSQL, paras))
            {
                if (reader.Read() == false) return null;
                LoadFromReader(reader, ref entity);
                return entity;
            }
        }

        /// <summary>
        /// 更新StockquotationsEntity
        /// </summary>
        /// <param name="entity">Entity</param>	
        public static void UpdateStockquotations(StockquotationsEntity entity)
        {
            if (entity == null)
            {
                throw new Exception("参数[entity]为[null]！");
            }
            IDbDataParameter[] paras = GenerateParas(entity);
            db.ExecuteNonQuery(updateSQL, paras);
        }




        /// <summary>
        ///  插入一条记录
        /// </summary>
        /// <param name="id">id</param>		
        public static void InsertStockquotations(StockquotationsEntity entity)
        {
            if (entity == null)
            {
                throw new Exception("参数[entity]为[null]！");
            }
            DeletedRecordBySecCodeAndTradeDate(entity.seccode, entity.tradeday.Value);
            IDbDataParameter[] paras = GenerateParas(entity);
            db.ExecuteNonQuery(insertSQL, paras);
        }

        /// <summary>
        ///  删除一条记录
        /// </summary>
        /// <param name="id">id</param>		
        public static void DeleteStockquotations(int id)
        {
            IDbDataParameter para_id = new NpgsqlParameter("id", NpgsqlDbType.Integer);
            para_id.Value = id;
            IDbDataParameter[] paras = new IDbDataParameter[] { para_id };
            db.ExecuteNonQuery(deleteSQL, paras);
        }



        /// <summary>
        /// 删除多条记录
        /// </summary>
        /// <param name="ids">ids</param>		
        public static void DeleteStockquotations(List<int> ids)
        {
            string strSQL = "DELETE FROM  stockquotations  Where id in ({0}) ";
            string deleteIds = DBHelper.ConvertListToSQLString<int>(ids);
            db.ExecuteNonQuery(string.Format(strSQL, deleteIds), null);
        }



        /// <summary>
        /// 根据分页条件获取Stockquotations数据集
        /// </summary>
        /// <param name="conditions">条件</param>	
        /// <param name="sortExpression">排序表达式，为空则默认为:id</param>		
        /// <param name="pageIndex">开始页码：分页查询中的开始页码</param>
        /// <param name="pageSize">页宽：分页查询中的每页的记录数</param>
        /// <param name="recordCount">页宽：分页查询中的每页的记录数</param>		
        /// <returns>数据集(List)</returns>
        public static List<StockquotationsEntity> GetStockquotationssByCond(string conditions, string sortExpression, int pageIndex, int pageSize, out int recordCount)
        {
            string viewName = "vwstockquotations";
            return db.GetDataListByCond<StockquotationsEntity>
                (viewName, conditions, sortExpression, pageIndex, pageSize, out recordCount, LoadFromReader);
        }

        public static DataTable GetStockquotationsDataTasbleByCond(string conditions, string sortExpression, int pageIndex, int pageSize, out int recordCount)
        {
            recordCount = 0;
            string viewName = "vwstockquotations";
            return db.GetDataListByCond(viewName,"*", conditions, sortExpression, pageIndex, pageSize, out recordCount);
        }


        /// <summary>
        /// 根据条件获取Stockquotations数据集
        /// </summary>
        /// <param name="fields">查询的列(如果为空，则表示查询所有列)</param>	
        /// <param name="conditions">条件</param>	
        /// <param name="sortExpression">排序表达式，为空则默认为:id</param>		
        /// <returns>数据集(DataTable)：<br/></returns>
        public static DataTable GetStockquotationssByCond(string fields, string conditions, string sortExpression)
        {
            string viewName = "vwstockquotations";
            return db.GetDataTableByCond(viewName, fields, conditions, sortExpression);
        }
        #region private method
        /// <summary>
        /// 获取StockquotationsEntity实体数据更新参数
        /// </summary>
        /// <param name="entity">CompanyEntity</param>
        /// <returns></returns>
        private static IDbDataParameter[] GenerateParas(StockquotationsEntity entity)
        {
            IDbDataParameter para_id = new NpgsqlParameter("id", NpgsqlDbType.Integer);
            para_id.Value = entity.id;

            IDbDataParameter para_outflowretail = new NpgsqlParameter("outflowretail", NpgsqlDbType.Numeric);
            para_outflowretail.Value = entity.outflowretail;

            IDbDataParameter para_inflowretail = new NpgsqlParameter("inflowretail", NpgsqlDbType.Numeric);
            para_inflowretail.Value = entity.inflowretail;

            IDbDataParameter para_outflowmain = new NpgsqlParameter("outflowmain", NpgsqlDbType.Numeric);
            para_outflowmain.Value = entity.outflowmain;

            IDbDataParameter para_inflowmain = new NpgsqlParameter("inflowmain", NpgsqlDbType.Numeric);
            para_inflowmain.Value = entity.inflowmain;

            IDbDataParameter para_changeratio = new NpgsqlParameter("changeratio", NpgsqlDbType.Numeric);
            para_changeratio.Value = entity.changeratio;

            IDbDataParameter para_turnoverrate = new NpgsqlParameter("turnoverrate", NpgsqlDbType.Numeric);
            para_turnoverrate.Value = entity.turnoverrate;

            IDbDataParameter para_modifytime = new NpgsqlParameter("modifytime", NpgsqlDbType.Timestamp);
            if (entity.modifytime.HasValue)
            {
                para_modifytime.Value = DateTime.Parse(string.Format(entity.modifytime.Value.ToString(), "yyyy-MM-dd HH:mm:ss"));
            }
            else
            {
                para_modifytime.Value = null;
            }

            IDbDataParameter para_createtime = new NpgsqlParameter("createtime", NpgsqlDbType.Timestamp);
            if (entity.createtime.HasValue)
            {
                para_createtime.Value = DateTime.Parse(string.Format(entity.createtime.Value.ToString(), "yyyy-MM-dd HH:mm:ss"));
            }
            else
            {
                para_createtime.Value = null;
            }

            IDbDataParameter para_sellingprice5 = new NpgsqlParameter("sellingprice5", NpgsqlDbType.Numeric);
            para_sellingprice5.Value = entity.sellingprice5;

            IDbDataParameter para_sellingvolume5 = new NpgsqlParameter("sellingvolume5", NpgsqlDbType.Numeric);
            para_sellingvolume5.Value = entity.sellingvolume5;

            IDbDataParameter para_sellingprice4 = new NpgsqlParameter("sellingprice4", NpgsqlDbType.Numeric);
            para_sellingprice4.Value = entity.sellingprice4;

            IDbDataParameter para_sellingvolume4 = new NpgsqlParameter("sellingvolume4", NpgsqlDbType.Numeric);
            para_sellingvolume4.Value = entity.sellingvolume4;

            IDbDataParameter para_sellingprice3 = new NpgsqlParameter("sellingprice3", NpgsqlDbType.Numeric);
            para_sellingprice3.Value = entity.sellingprice3;

            IDbDataParameter para_sellingvolume3 = new NpgsqlParameter("sellingvolume3", NpgsqlDbType.Numeric);
            para_sellingvolume3.Value = entity.sellingvolume3;

            IDbDataParameter para_sellingprice2 = new NpgsqlParameter("sellingprice2", NpgsqlDbType.Numeric);
            para_sellingprice2.Value = entity.sellingprice2;

            IDbDataParameter para_sellingvolume2 = new NpgsqlParameter("sellingvolume2", NpgsqlDbType.Numeric);
            para_sellingvolume2.Value = entity.sellingvolume2;

            IDbDataParameter para_sellingprice1 = new NpgsqlParameter("sellingprice1", NpgsqlDbType.Numeric);
            para_sellingprice1.Value = entity.sellingprice1;

            IDbDataParameter para_sellingvolume1 = new NpgsqlParameter("sellingvolume1", NpgsqlDbType.Numeric);
            para_sellingvolume1.Value = entity.sellingvolume1;

            IDbDataParameter para_buyingprice5 = new NpgsqlParameter("buyingprice5", NpgsqlDbType.Numeric);
            para_buyingprice5.Value = entity.buyingprice5;

            IDbDataParameter para_buyingvolume5 = new NpgsqlParameter("buyingvolume5", NpgsqlDbType.Numeric);
            para_buyingvolume5.Value = entity.buyingvolume5;

            IDbDataParameter para_buyingprice4 = new NpgsqlParameter("buyingprice4", NpgsqlDbType.Numeric);
            para_buyingprice4.Value = entity.buyingprice4;

            IDbDataParameter para_buyingvolume4 = new NpgsqlParameter("buyingvolume4", NpgsqlDbType.Numeric);
            para_buyingvolume4.Value = entity.buyingvolume4;

            IDbDataParameter para_buyingprice3 = new NpgsqlParameter("buyingprice3", NpgsqlDbType.Numeric);
            para_buyingprice3.Value = entity.buyingprice3;

            IDbDataParameter para_buyingvolume3 = new NpgsqlParameter("buyingvolume3", NpgsqlDbType.Numeric);
            para_buyingvolume3.Value = entity.buyingvolume3;

            IDbDataParameter para_buyingprice2 = new NpgsqlParameter("buyingprice2", NpgsqlDbType.Numeric);
            para_buyingprice2.Value = entity.buyingprice2;

            IDbDataParameter para_buyingvolume2 = new NpgsqlParameter("buyingvolume2", NpgsqlDbType.Numeric);
            para_buyingvolume2.Value = entity.buyingvolume2;

            IDbDataParameter para_buyingprice1 = new NpgsqlParameter("buyingprice1", NpgsqlDbType.Numeric);
            para_buyingprice1.Value = entity.buyingprice1;

            IDbDataParameter para_buyingvolume1 = new NpgsqlParameter("buyingvolume1", NpgsqlDbType.Numeric);
            para_buyingvolume1.Value = entity.buyingvolume1;

            IDbDataParameter para_reserveprice = new NpgsqlParameter("reserveprice", NpgsqlDbType.Numeric);
            para_reserveprice.Value = entity.reserveprice;

            IDbDataParameter para_competitiveprice = new NpgsqlParameter("competitiveprice", NpgsqlDbType.Numeric);
            para_competitiveprice.Value = entity.competitiveprice;

            IDbDataParameter para_tradingmoneyvolume = new NpgsqlParameter("tradingmoneyvolume", NpgsqlDbType.Numeric);
            para_tradingmoneyvolume.Value = entity.tradingmoneyvolume;

            IDbDataParameter para_tradingvolume = new NpgsqlParameter("tradingvolume", NpgsqlDbType.Numeric);
            para_tradingvolume.Value = entity.tradingvolume;

            IDbDataParameter para_todaylowestprice = new NpgsqlParameter("todaylowestprice", NpgsqlDbType.Numeric);
            para_todaylowestprice.Value = entity.todaylowestprice;

            IDbDataParameter para_todayhighestprice = new NpgsqlParameter("todayhighestprice", NpgsqlDbType.Numeric);
            para_todayhighestprice.Value = entity.todayhighestprice;

            IDbDataParameter para_todayclosingprice = new NpgsqlParameter("todayclosingprice", NpgsqlDbType.Numeric);
            para_todayclosingprice.Value = entity.todayclosingprice;

            IDbDataParameter para_yesterdayclosingprice = new NpgsqlParameter("yesterdayclosingprice", NpgsqlDbType.Numeric);
            para_yesterdayclosingprice.Value = entity.yesterdayclosingprice;

            IDbDataParameter para_todayopeningprice = new NpgsqlParameter("todayopeningprice", NpgsqlDbType.Numeric);
            para_todayopeningprice.Value = entity.todayopeningprice;

            IDbDataParameter para_tradeday = new NpgsqlParameter("tradeday", NpgsqlDbType.Date);
            para_tradeday.Value = entity.tradeday;

            IDbDataParameter para_seccode = new NpgsqlParameter("seccode", NpgsqlDbType.Varchar);
            para_seccode.Value = entity.seccode;

            return new IDbDataParameter[] { para_id, para_outflowretail, para_inflowretail, para_outflowmain, para_inflowmain, para_changeratio, para_turnoverrate, para_modifytime, para_createtime, para_sellingprice5, para_sellingvolume5, para_sellingprice4, para_sellingvolume4, para_sellingprice3, para_sellingvolume3, para_sellingprice2, para_sellingvolume2, para_sellingprice1, para_sellingvolume1, para_buyingprice5, para_buyingvolume5, para_buyingprice4, para_buyingvolume4, para_buyingprice3, para_buyingvolume3, para_buyingprice2, para_buyingvolume2, para_buyingprice1, para_buyingvolume1, para_reserveprice, para_competitiveprice, para_tradingmoneyvolume, para_tradingvolume, para_todaylowestprice, para_todayhighestprice, para_todayclosingprice, para_yesterdayclosingprice, para_todayopeningprice, para_tradeday, para_seccode };
        }

        /// <summary>
        /// 绑定数据到业务实体
        /// </summary>
        /// <param name="reader">DataReader</param>
        /// <param name="entity">业务实体</param>
        private static void LoadFromReader(IDataReader reader, ref StockquotationsEntity entity)
        {
            if (reader != null && !reader.IsClosed)
            {
                //entity.Id = reader.GetInt32(0);
                if (!Convert.IsDBNull(reader["id"])) entity.id = (int)reader["id"];
                if (!Convert.IsDBNull(reader["outflowretail"])) entity.outflowretail = (decimal)reader["outflowretail"];
                if (!Convert.IsDBNull(reader["inflowretail"])) entity.inflowretail = (decimal)reader["inflowretail"];
                if (!Convert.IsDBNull(reader["outflowmain"])) entity.outflowmain = (decimal)reader["outflowmain"];
                if (!Convert.IsDBNull(reader["inflowmain"])) entity.inflowmain = (decimal)reader["inflowmain"];
                if (!Convert.IsDBNull(reader["changeratio"])) entity.changeratio = (decimal)reader["changeratio"];
                if (!Convert.IsDBNull(reader["turnoverrate"])) entity.turnoverrate = (decimal)reader["turnoverrate"];
                if (!Convert.IsDBNull(reader["modifytime"])) entity.modifytime = (DateTime)reader["modifytime"];
                if (!Convert.IsDBNull(reader["createtime"])) entity.createtime = (DateTime)reader["createtime"];
                if (!Convert.IsDBNull(reader["sellingprice5"])) entity.sellingprice5 = (decimal)reader["sellingprice5"];
                if (!Convert.IsDBNull(reader["sellingvolume5"])) entity.sellingvolume5 = (decimal)reader["sellingvolume5"];
                if (!Convert.IsDBNull(reader["sellingprice4"])) entity.sellingprice4 = (decimal)reader["sellingprice4"];
                if (!Convert.IsDBNull(reader["sellingvolume4"])) entity.sellingvolume4 = (decimal)reader["sellingvolume4"];
                if (!Convert.IsDBNull(reader["sellingprice3"])) entity.sellingprice3 = (decimal)reader["sellingprice3"];
                if (!Convert.IsDBNull(reader["sellingvolume3"])) entity.sellingvolume3 = (decimal)reader["sellingvolume3"];
                if (!Convert.IsDBNull(reader["sellingprice2"])) entity.sellingprice2 = (decimal)reader["sellingprice2"];
                if (!Convert.IsDBNull(reader["sellingvolume2"])) entity.sellingvolume2 = (decimal)reader["sellingvolume2"];
                if (!Convert.IsDBNull(reader["sellingprice1"])) entity.sellingprice1 = (decimal)reader["sellingprice1"];
                if (!Convert.IsDBNull(reader["sellingvolume1"])) entity.sellingvolume1 = (decimal)reader["sellingvolume1"];
                if (!Convert.IsDBNull(reader["buyingprice5"])) entity.buyingprice5 = (decimal)reader["buyingprice5"];
                if (!Convert.IsDBNull(reader["buyingvolume5"])) entity.buyingvolume5 = (decimal)reader["buyingvolume5"];
                if (!Convert.IsDBNull(reader["buyingprice4"])) entity.buyingprice4 = (decimal)reader["buyingprice4"];
                if (!Convert.IsDBNull(reader["buyingvolume4"])) entity.buyingvolume4 = (decimal)reader["buyingvolume4"];
                if (!Convert.IsDBNull(reader["buyingprice3"])) entity.buyingprice3 = (decimal)reader["buyingprice3"];
                if (!Convert.IsDBNull(reader["buyingvolume3"])) entity.buyingvolume3 = (decimal)reader["buyingvolume3"];
                if (!Convert.IsDBNull(reader["buyingprice2"])) entity.buyingprice2 = (decimal)reader["buyingprice2"];
                if (!Convert.IsDBNull(reader["buyingvolume2"])) entity.buyingvolume2 = (decimal)reader["buyingvolume2"];
                if (!Convert.IsDBNull(reader["buyingprice1"])) entity.buyingprice1 = (decimal)reader["buyingprice1"];
                if (!Convert.IsDBNull(reader["buyingvolume1"])) entity.buyingvolume1 = (decimal)reader["buyingvolume1"];
                if (!Convert.IsDBNull(reader["reserveprice"])) entity.reserveprice = (decimal)reader["reserveprice"];
                if (!Convert.IsDBNull(reader["competitiveprice"])) entity.competitiveprice = (decimal)reader["competitiveprice"];
                if (!Convert.IsDBNull(reader["tradingmoneyvolume"])) entity.tradingmoneyvolume = (decimal)reader["tradingmoneyvolume"];
                if (!Convert.IsDBNull(reader["tradingvolume"])) entity.tradingvolume = (decimal)reader["tradingvolume"];
                if (!Convert.IsDBNull(reader["todaylowestprice"])) entity.todaylowestprice = (decimal)reader["todaylowestprice"];
                if (!Convert.IsDBNull(reader["todayhighestprice"])) entity.todayhighestprice = (decimal)reader["todayhighestprice"];
                if (!Convert.IsDBNull(reader["todayclosingprice"])) entity.todayclosingprice = (decimal)reader["todayclosingprice"];
                if (!Convert.IsDBNull(reader["yesterdayclosingprice"])) entity.yesterdayclosingprice = (decimal)reader["yesterdayclosingprice"];
                if (!Convert.IsDBNull(reader["todayopeningprice"])) entity.todayopeningprice = (decimal)reader["todayopeningprice"];
                if (!Convert.IsDBNull(reader["tradeday"])) entity.tradeday = (DateTime)reader["tradeday"];
                if (!Convert.IsDBNull(reader["seccode"])) entity.seccode = reader["seccode"].ToString();
                if (!Convert.IsDBNull(reader["secshortname"])) entity.secshortname = reader["secshortname"].ToString();
                //int indexOfsecshortname = reader.GetOrdinal("secshortname");
                //if (indexOfsecshortname > -1)
                //{
                    
                //}
            }

        }
        #endregion

        #endregion

        #region 手工增加的代码
        public static void DeletedRecordBySecCodeAndTradeDate(string secCode, DateTime date)
        {
            string strDeletesql = "DELETE FROM  stockquotations  Where seccode=@seccode and tradeday=@tradeday";

            IDbDataParameter para_seccode = new NpgsqlParameter("seccode", NpgsqlDbType.Varchar);
            para_seccode.Value = secCode;

            IDbDataParameter para_tradeday = new NpgsqlParameter("tradeday", NpgsqlDbType.Date);
            para_tradeday.Value = date.Date;
            IDbDataParameter[] paras = new IDbDataParameter[] {para_seccode, para_tradeday };

            db.ExecuteNonQuery(strDeletesql, paras);
        }

        /// <summary>
        ///  插入一条记录
        /// </summary>
        /// <param name="id">id</param>		
        //public static void InsertStockquotations2(StockquotationsEntity entity)
        //{
        //    DbHelper db2 = DbHelper.CreateDatabase(true);
        //    if (entity == null)
        //    {
        //        throw new Exception("参数[entity]为[null]！");
        //    }

        //    string secCode=entity.seccode;
        //    DateTime tradeDate = entity.tradeday.Value;
        //    string strDeletesql = "DELETE FROM  stockquotations  Where seccode=@seccode and tradeday=@tradeday";
        //    IDbDataParameter para_seccode = new NpgsqlParameter("seccode", NpgsqlDbType.Varchar);
        //    para_seccode.Value = secCode;
        //    IDbDataParameter para_tradeday = new NpgsqlParameter("tradeday", NpgsqlDbType.Date);
        //    para_tradeday.Value = tradeDate.Date;
        //    IDbDataParameter[] paras = new IDbDataParameter[] { para_seccode, para_tradeday };
        //    db2.ExecuteNonQuery(strDeletesql, paras);


        //    IDbDataParameter[] paras2 = GenerateParas(entity);
        //    db2.ExecuteNonQuery(insertSQL, paras2);
        //}
        #endregion
    }
}
